<ui:composition template="template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

	<ui:define name="registrationDefine">
		<h:form>

			<p:panel header="Registration">
				<p:messages id="messages" showDetail="true" autoUpdate="true"
					closable="true" />
				<h:panelGrid id="grid" columns="3">

					<h:outputText id="title" value="Titel " />
					<br></br>
					<br></br>
					<br></br>
					<p:selectOneMenu value="#{customer.sTitle}">
						<f:selectItem itemLabel="Bitte waehlen" itemValue="" />
						<f:selectItem itemLabel="Herr" itemValue="Herr" />
						<f:selectItem itemLabel="Frau" itemValue="Frau" />
					</p:selectOneMenu>
				</h:panelGrid>

				<h:panelGrid columns="3">
					<h:outputText value="Vorname *" />
					<p:inputText id="inputName" value="#{customer.sForename}"
						required="true">
						<f:validateRegex pattern="[a-zA-Z]+" />
					</p:inputText>
					<p:message for="inputName" />

					<h:outputText value="Nachname *" />
					<p:inputText id="inputLastName" value="#{customer.sLastname}"
						required="true">
						<f:validateRegex pattern="[a-zA-Z]+" />
					</p:inputText>
					<p:message for="inputLastName" />

					<h:outputText value="Passwort *" />
					<p:password id="inputPass1" value="#{registerCtrl.sPassword1}"
						required="true" />
					<p:message for="inputPass1" />

					<h:outputText value="Passwort wiederholen *" />
					<p:password id="inputPass2" value="#{registerCtrl.sPassword2}" required="true" />
					<p:message for="inputPass2" />

					<br></br>
					<br></br>


					<h:outputText value="Bitte fuegen Sie noch eine Adresse hinzu: " />
					<br></br>

					<h:outputText value="Strasse *" />
					<p:inputMask id="inStreet" value="#{adress.sStreet}" required="true">
						<f:validateRegex pattern="[a-zA-Z]+"/>
					</p:inputMask>
					<p:message for="inStreet" />

					<h:outputText value="Haus Nr. *" />
					<p:inputMask id="inHnr" value="#{adress.sHouseNr}" required="true" />
					<p:message for="inHnr" />

					<h:outputText value="PLZ *" />
					<p:inputText id="inPCode" value="#{adress.iPostcode}" required="true">
					<f:validateLength minimum="5" maximum="5"/>
					</p:inputText>
					<p:message for="inPCode" />

					<h:outputText value="Ort *" />
					<p:inputMask id="inCity" value="#{adress.sCity}" required="true">
						<f:validateRegex pattern="[a-zA-Z]+" />
					</p:inputMask>
					<p:message for="inCity" />

					<h:outputText value="Land *" />
					<p:inputMask id="inCountry" value="#{adress.sCountry}" required="true">
					<f:validateRegex pattern="[a-zA-Z]+"/>
					</p:inputMask>
					<p:message for="inCountry" />

					<p:commandButton value="Reset" type="reset" />
					<p:commandButton value="Registrieren"
						action="#{registerCtrl.register(adress)}" ajax="false" />

				</h:panelGrid>
			</p:panel>

		</h:form>
	</ui:define>
</ui:composition>
